<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<link rel="stylesheet" href="./css/layui.css">
	<script type="text/javascript" src='./layui.js'></script>
</head>
<body>

<form action="" method="post" class="layui-form">
	<input type="radio" name="sex" value="男" title="xxx">
<input type="radio" name="sex" value="女" title="女" checked>
<input type="radio" name="sex" value="中性" title="中性" >

<select name="city" lay-verify="">
  <option value="">请选择一个城市</option>
  <option value="010">北京</option>
  <option value="021">上海</option>
  <option value="0571">杭州</option>
</select> 

	<input type="tel" name="username" lay-verify="required" autocomplete="off" id="username" class="layui-input">

	<button class="layui-btn" lay-submit="" lay-filter="xbs">立即提交</button>
</form>

<script>
 
	//一般直接写在一个js文件中
	layui.use(['layer','form','jquery'], function(){
	  
	  var layer = layui.layer;
	  var form = layui.form();
	  var $ = layui.jquery;

	  $('#username').blur(function(event) {
	  		layer.alert("我失去焦点了");
	  });
	  

	  layer.alert("这个是一个弹出层");
	  // 
	//   layer.confirm('您是如何看待前端开发？', {
	// 		  btn: ['重要xxx','奇葩bbb'] //按钮
	// 		}, function(){
	// 		  alert(777)
	// 		}, function(){
	// 		  alert(888)
	// });

	// layer.msg('不开心。。', {icon: 1});
	// 
	// //监听提交
	  form.on('submit(xbs)', function(data){

	    console.log(data);
	    return false;
	  });
  




	});
</script> 
</body>
</html>